// pages/print/local/local.js
const utils = require("../../../utils/utils")
const app = getApp();
Page({

  /**
   * 页面的初始数据
   */
  data: {

  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    var url = '';
    app.get_local('machineQrCode').then(res =>{
      var time = new Date().getTime();
      if(utils.is_define(options.addList)){
        url = 'https://service.zv100.net/h5/select/qq.html?addList='+options.addList+'&sn='+res+'&code='+options.code+'&serviceMainId='+options.serviceMainId+'&serviceSubtypeId='+options.serviceSubtypeId+'&tagFloor='+options.tagFloor+'&uid='+wx.getStorageSync('uid')+'&token='+wx.getStorageSync('AccToken')+'&time='+time
      }else{
        url = 'https://service.zv100.net/h5/select/qq.html?sn='+res+'&addList=&code='+options.code+'&serviceMainId='+options.serviceMainId+'&serviceSubtypeId='+options.serviceSubtypeId+'&tagFloor='+options.tagFloor+'&uid='+wx.getStorageSync('uid')+'&token='+wx.getStorageSync('AccToken')+'&time='+time
      }
      this.setData({
        url:url
      })
    })
  },
  getMessage(e){
    let pages = getCurrentPages();
    let prevPage = pages[pages.length - 2];
    var obj = {};
    obj.currentNum = 1;
    obj.pageNum = 1;
    obj.fileUrl = 1;
    obj.name =1;
    obj.code = 1;
    obj.currentColor = 2;
    obj.currentFace = 1;
    obj.currentPaper = 1;
    prevPage.setData({
        currentObj:obj,
        type:2,
        without:true
    })
  },
  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  }
})